package com.itheima.多线程.基础;

public class ThreadSleep implements Runnable {
    @Override
    public void run() {
        System.out.println("    " + Thread.currentThread().getName());
        for (int hour = 0; hour < 24; hour++) {
            for (int minute = 0; minute < 60; minute++) {
                for (int second = 0; second < 60; second++) {
                    try {
                        System.out.println(hour + " 时 " + minute + " 分 " + second + " 秒 ");
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }
}

class Testdemo2 {
    public static void main(String[] args) {
        ThreadSleep ts = new ThreadSleep();
        Thread th = new Thread(ts, " 钟表 ");
        th.start();
    }
}
